export default function presskey(key) {
  if (HTMLElement && !HTMLElement.prototype.presskey) {
    HTMLElement.prototype.presskey = function (code) {
      let event = document.createEvent('UIEvents')
      event.keyCode = code
      event.initEvent('keydown', true, true)
      this.dispatchEvent(event)
    }
  }
  document.body.presskey(key)
}